All files / web/src/app/api/abacus/print/printers/[id]/filaments route.ts

0% Statements 0/16
0% Branches 0/1
0% Functions 0/1
0% Lines 0/16

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17                                 
/**
 * GET /api/abacus/print/printers/[id]/filaments (Abacus Studio #8.3)
 *
 * Pass-through of the printer's loaded filament roster (THH wire shape:
 * `{printerId, filaments: [{slotId, colorHex, …}]}`) — the studio's
 * catalog projection consumes this verbatim.
 */
import { withAuth } from '@/lib/auth/withAuth'
import { getUserId } from '@/lib/viewer'
import { proxyPass } from '@/lib/abacus/print/proxy'

export const GET = withAuth(async (request, { params }) => {
  const { id } = (await params) as { id: string }
  const userId = await getUserId()
  return proxyPass(request, userId, `/printers/${encodeURIComponent(id)}/filaments`)
})